package com.ruoyi.base.service.impl;

import java.util.List;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.base.mapper.BasSpacefacilityMapper;
import com.ruoyi.base.domain.BasSpacefacility;
import com.ruoyi.base.service.IBasSpacefacilityService;

/**
 * 公共设施Service业务层处理
 * 
 * @author maliang
 * @date 2025-08-20
 */
@Service
public class BasSpacefacilityServiceImpl implements IBasSpacefacilityService 
{
    @Autowired
    private BasSpacefacilityMapper basSpacefacilityMapper;

    /**
     * 查询公共设施
     * 
     * @param id 公共设施主键
     * @return 公共设施
     */
    @Override
    public BasSpacefacility selectBasSpacefacilityById(String id)
    {
        return basSpacefacilityMapper.selectBasSpacefacilityById(id);
    }

    /**
     * 查询公共设施列表
     * 
     * @param basSpacefacility 公共设施
     * @return 公共设施
     */
    @Override
    public List<BasSpacefacility> selectBasSpacefacilityList(BasSpacefacility basSpacefacility)
    {
        return basSpacefacilityMapper.selectBasSpacefacilityList(basSpacefacility);
    }

    /**
     * 新增公共设施
     * 
     * @param basSpacefacility 公共设施
     * @return 结果
     */
    @Override
    public int insertBasSpacefacility(BasSpacefacility basSpacefacility)
    {
        basSpacefacility.setId(UUID.randomUUID().toString());
        return basSpacefacilityMapper.insertBasSpacefacility(basSpacefacility);
    }

    /**
     * 修改公共设施
     * 
     * @param basSpacefacility 公共设施
     * @return 结果
     */
    @Override
    public int updateBasSpacefacility(BasSpacefacility basSpacefacility)
    {
        return basSpacefacilityMapper.updateBasSpacefacility(basSpacefacility);
    }

    /**
     * 批量删除公共设施
     * 
     * @param ids 需要删除的公共设施主键
     * @return 结果
     */
    @Override
    public int deleteBasSpacefacilityByIds(String[] ids)
    {
        return basSpacefacilityMapper.deleteBasSpacefacilityByIds(ids);
    }

    /**
     * 删除公共设施信息
     * 
     * @param id 公共设施主键
     * @return 结果
     */
    @Override
    public int deleteBasSpacefacilityById(String id)
    {
        return basSpacefacilityMapper.deleteBasSpacefacilityById(id);
    }
}
